// 全局样式文件 - 深灰色主题
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #1a1a1a;
  color: #e5e5e5;
}

#app {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

// 深色主题滚动条样式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #777777;
}

::-webkit-scrollbar-corner {
  background: #2d2d2d;
}

// Element Plus 深色主题覆盖
.el-card {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%) !important;
  border: 1px solid #404040 !important;
  color: #e5e5e5 !important;
}

.el-card__header {
  background: rgba(64, 158, 255, 0.1) !important;
  border-bottom: 1px solid #404040 !important;
  color: #ffffff !important;
}

.el-button {
  border-color: #404040 !important;
  background: #2d2d2d !important;
  color: #e5e5e5 !important;
}

.el-button:hover {
  background: #404040 !important;
  border-color: #409eff !important;
  color: #409eff !important;
}

.el-button--primary {
  background: linear-gradient(135deg, #409eff 0%, #67c23a 100%) !important;
  border-color: #409eff !important;
  color: #ffffff !important;
}

.el-button--primary:hover {
  background: linear-gradient(135deg, #66b1ff 0%, #85ce61 100%) !important;
}

.el-input__wrapper {
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
  color: #e5e5e5 !important;
}

.el-input__inner {
  color: #e5e5e5 !important;
  background: transparent !important;
}

.el-input__wrapper:hover {
  border-color: #409eff !important;
}

.el-input__wrapper.is-focus {
  border-color: #409eff !important;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2) !important;
}

.el-select .el-input__wrapper {
  background: #2d2d2d !important;
}

.el-popper {
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
}

.el-select-dropdown__item {
  color: #e5e5e5 !important;
}

.el-select-dropdown__item:hover {
  background: #404040 !important;
}

.el-select-dropdown__item.selected {
  background: #409eff !important;
  color: #ffffff !important;
}

.el-table {
  background: #2d2d2d !important;
  color: #e5e5e5 !important;
}

.el-table th {
  background: #404040 !important;
  color: #ffffff !important;
  border-bottom: 1px solid #555555 !important;
}

.el-table td {
  border-bottom: 1px solid #404040 !important;
}

.el-table tr:hover > td {
  background: #404040 !important;
}

.el-pagination {
  color: #e5e5e5 !important;
}

.el-pagination button {
  background: #2d2d2d !important;
  color: #e5e5e5 !important;
  border: 1px solid #404040 !important;
}

.el-pagination button:hover {
  color: #409eff !important;
}

.el-pager li {
  background: #2d2d2d !important;
  color: #e5e5e5 !important;
  border: 1px solid #404040 !important;
}

.el-pager li:hover {
  color: #409eff !important;
}

.el-pager li.active {
  background: #409eff !important;
  color: #ffffff !important;
}

.el-dialog {
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
}

.el-dialog__header {
  background: rgba(64, 158, 255, 0.1) !important;
  border-bottom: 1px solid #404040 !important;
}

.el-dialog__title {
  color: #ffffff !important;
}

.el-dialog__body {
  color: #e5e5e5 !important;
}

.el-form-item__label {
  color: #e5e5e5 !important;
}

.el-textarea__inner {
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
  color: #e5e5e5 !important;
}

.el-textarea__inner:hover {
  border-color: #409eff !important;
}

.el-textarea__inner:focus {
  border-color: #409eff !important;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2) !important;
}

// 通用工具类
.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

// 间距工具类
.m-0 { margin: 0; }
.m-8 { margin: 8px; }
.m-16 { margin: 16px; }
.m-24 { margin: 24px; }
.m-32 { margin: 32px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.ml-0 { margin-left: 0; }
.ml-8 { margin-left: 8px; }
.ml-16 { margin-left: 16px; }
.ml-24 { margin-left: 24px; }
.ml-32 { margin-left: 32px; }

.mr-0 { margin-right: 0; }
.mr-8 { margin-right: 8px; }
.mr-16 { margin-right: 16px; }
.mr-24 { margin-right: 24px; }
.mr-32 { margin-right: 32px; }

.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.pt-0 { padding-top: 0; }
.pt-8 { padding-top: 8px; }
.pt-16 { padding-top: 16px; }
.pt-24 { padding-top: 24px; }
.pt-32 { padding-top: 32px; }

.pb-0 { padding-bottom: 0; }
.pb-8 { padding-bottom: 8px; }
.pb-16 { padding-bottom: 16px; }
.pb-24 { padding-bottom: 24px; }
.pb-32 { padding-bottom: 32px; }

.pl-0 { padding-left: 0; }
.pl-8 { padding-left: 8px; }
.pl-16 { padding-left: 16px; }
.pl-24 { padding-left: 24px; }
.pl-32 { padding-left: 32px; }

.pr-0 { padding-right: 0; }
.pr-8 { padding-right: 8px; }
.pr-16 { padding-right: 16px; }
.pr-24 { padding-right: 24px; }
.pr-32 { padding-right: 32px; }

// 深色主题卡片样式
.dark-card {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border: 1px solid #404040;
  border-radius: 12px;
  color: #e5e5e5;
  transition: all 0.3s ease;
}

.dark-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

// 深色主题面板样式
.dark-panel {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border: 1px solid #404040;
  border-radius: 12px;
  overflow: hidden;
}

.dark-panel-header {
  padding: 20px 24px;
  background: rgba(64, 158, 255, 0.1);
  border-bottom: 1px solid #404040;
  color: #ffffff;
  font-weight: 600;
}

.dark-panel-content {
  padding: 24px;
  color: #e5e5e5;
}

// 状态指示器
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-online {
  background: #67c23a;
  box-shadow: 0 0 8px rgba(103, 194, 58, 0.5);
}

.status-offline {
  background: #f56c6c;
  box-shadow: 0 0 8px rgba(245, 108, 108, 0.5);
}

.status-warning {
  background: #e6a23c;
  box-shadow: 0 0 8px rgba(230, 162, 60, 0.5);
}

// 响应式工具类
@media (max-width: 768px) {
  .mobile-hidden {
    display: none !important;
  }
  
  .mobile-full-width {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .mobile-sm-hidden {
    display: none !important;
  }
  
  .mobile-sm-stack {
    flex-direction: column !important;
  }
}

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

// 加载动画
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #404040;
  border-radius: 50%;
  border-top-color: #409eff;
  animation: spin 1s ease-in-out infinite;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

// 通用类
.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.p-16 {
  padding: 16px;
}

.p-24 {
  padding: 24px;
}

// 卡片阴影
.card-shadow {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

// 布局样式
.layout-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout-header {
  height: 60px;
  border-bottom: 1px solid #e4e7ed;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1001;
}

.layout-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.layout-sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e4e7ed;
  overflow-y: auto;
}

.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-header {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

// 工作流设计器样式
.workflow-designer {
  height: 100%;
  position: relative;
  
  .designer-toolbar {
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
  }
  
  .designer-content {
    height: calc(100% - 48px);
    display: flex;
  }
  
  .designer-panel {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    padding: 16px;
    overflow-y: auto;
  }
  
  .designer-canvas {
    flex: 1;
    position: relative;
    background: #f8f9fa;
  }
  
  .designer-properties {
    width: 300px;
    background: #fff;
    border-left: 1px solid #e4e7ed;
    padding: 16px;
    overflow-y: auto;
  }
}

// 节点样式
.workflow-node {
  position: absolute;
  min-width: 120px;
  min-height: 60px;
  background: #fff;
  border: 2px solid #409eff;
  border-radius: 8px;
  padding: 12px;
  cursor: move;
  user-select: none;
  
  &.selected {
    border-color: #f56c6c;
    box-shadow: 0 0 0 2px rgba(245, 108, 108, 0.2);
  }
  
  &.data-source {
    border-color: #67c23a;
  }
  
  &.data-transform {
    border-color: #e6a23c;
  }
  
  &.data-target {
    border-color: #909399;
  }
  
  .node-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .node-body {
    font-size: 12px;
    color: #666;
  }
  
  .node-ports {
    position: absolute;
    
    &.input {
      left: -6px;
      top: 50%;
      transform: translateY(-50%);
    }
    
    &.output {
      right: -6px;
      top: 50%;
      transform: translateY(-50%);
    }
    
    .port {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #409eff;
      border: 2px solid #fff;
      cursor: pointer;
      
      &:hover {
        transform: scale(1.2);
      }
    }
  }
}

// 连接线样式
.workflow-connection {
  position: absolute;
  pointer-events: none;
  
  .connection-line {
    stroke: #409eff;
    stroke-width: 2;
    fill: none;
  }
  
  .connection-arrow {
    fill: #409eff;
  }
}

// 数据地图样式
.data-map-container {
  height: 100%;
  display: flex;
  
  .map-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e4e7ed;
    padding: 16px;
    overflow-y: auto;
  }
  
  .map-content {
    flex: 1;
    position: relative;
  }
  
  .map-toolbar {
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
  }
  
  .map-canvas {
    height: calc(100% - 48px);
    position: relative;
  }
}

// 数据表节点样式
.table-node {
  background: #fff;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  padding: 12px;
  min-width: 200px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  
  .table-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    
    .table-icon {
      color: #409eff;
    }
    
    .table-name {
      font-weight: 600;
      font-size: 14px;
    }
  }
  
  .table-columns {
    font-size: 12px;
    color: #666;
    
    .column-item {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 2px 0;
      
      .column-type {
        color: #909399;
        font-size: 11px;
      }
    }
  }
}

// 血缘关系线样式
.lineage-edge {
  stroke: #409eff;
  stroke-width: 2;
  fill: none;
  marker-end: url(#arrowhead);
}

// 代码编辑器样式
.code-editor-container {
  height: 100%;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  overflow: hidden;
  
  .editor-toolbar {
    height: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    
    .editor-actions {
      margin-left: auto;
    }
  }
  
  .editor-content {
    height: calc(100% - 40px);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .layout-sidebar {
    width: 200px;
  }
  
  .workflow-designer {
    .designer-panel {
      width: 160px;
    }
    
    .designer-properties {
      width: 240px;
    }
  }
  
  .data-map-container {
    .map-sidebar {
      width: 240px;
    }
  }
}

@media (max-width: 576px) {
  .page-content {
    padding: 16px;
  }
  
  .layout-sidebar {
    position: fixed;
    left: -240px;
    top: 60px;
    height: calc(100vh - 60px);
    z-index: 1000;
    transition: left 0.3s ease;
    
    &.show {
      left: 0;
    }
  }
} 